package com.htgd.gardenexpo.service.impl;

import com.htgd.gardenexpo.entity.GeConPartyFeedback;
import com.htgd.gardenexpo.dao.GeConPartyFeedbackDao;
import com.htgd.gardenexpo.service.GeConPartyFeedbackService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (GeConPartyFeedback)表服务实现类
 *
 * @author makejava
 * @since 2021-06-08 17:21:36
 */
@Service("geConPartyFeedbackService")
public class GeConPartyFeedbackServiceImpl implements GeConPartyFeedbackService {
    @Resource
    private GeConPartyFeedbackDao geConPartyFeedbackDao;

    /**
     * 通过ID查询单条数据
     *
     * @param 主键
     * @return 实例对象
     */
    @Override
    public GeConPartyFeedback queryById() {
        return this.geConPartyFeedbackDao.queryById();
    }

    /**
     * 查询多条数据
     *
     * @param offset 查询起始位置
     * @param limit  查询条数
     * @return 对象列表
     */
    @Override
    public List<GeConPartyFeedback> queryAllByLimit(int offset, int limit) {
        return this.geConPartyFeedbackDao.queryAllByLimit(offset, limit);
    }
    @Override
    public List<GeConPartyFeedback> getinfoByPartyId(int id) {
        return this.geConPartyFeedbackDao.getinfoByPartyId(id);
    }

    /**
     * 新增数据
     *
     * @param geConPartyFeedback 实例对象
     * @return 实例对象
     */
    @Override
    public GeConPartyFeedback insert(GeConPartyFeedback geConPartyFeedback) {
        this.geConPartyFeedbackDao.insert(geConPartyFeedback);
        return geConPartyFeedback;
    }

    /**
     * 修改数据
     *
     * @param geConPartyFeedback 实例对象
     * @return 实例对象
     */
    @Override
    public GeConPartyFeedback update(GeConPartyFeedback geConPartyFeedback) {
        this.geConPartyFeedbackDao.update(geConPartyFeedback);
        return this.queryById();
    }

    /**
     * 通过主键删除数据
     *
     * @param 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById() {
        return this.geConPartyFeedbackDao.deleteById() > 0;
    }
    public boolean deleteByPartyId(int id) {
        return this.geConPartyFeedbackDao.deleteByPartyId(id) > 0;
    }
}
